<?php include("header.php"); ?>
<article
  ng-init="
  <?php
    include("functions/database.php");
    $idcheck = base64_decode($_GET['id']);
    $result = mysqli_query($con,"SELECT * FROM Help WHERE donate_id = $idcheck");
	while($row = mysqli_fetch_array($result))
    {
      echo "list.push({";
      echo "name: '" . $row['name'] . "',";
      echo "contact: '" . $row['contact'] . "',";
      echo "details: '" . $row['details'] . "'";
      echo "});";
    }
  ?>
  "
>
  <header>
    <h1>Connect!</h1>
	<div>
		<?php $result2 = mysqli_query($con,"SELECT * FROM DonateList WHERE id = $idcheck");
			while($row = mysqli_fetch_array($result2)) {
				echo "Details: " . $row['Details'] . "<br/>";
				echo "Location: " . $row['Location'] . "<br/>";
				echo "Name: " . $row['Name'] . "<br/>";
				echo "Contact: " . $row['Contact'] . "<br/>";
			}
	?>
	</div>
    <p>Here is a list of people who want to help:</p>
  </header>
  <header class="huge">
    <table id="donatelist">
      <thead>
        <tr>
        <th width="250">Name</th>
        <th width="250">Contact</th>
        <th width="600">Message</th>
        </tr>
      </thead>
      <tbody>
        <tr ng-repeat="item in list">
          <td ng-bind="item.name"> </td>
          <td ng-bind="item.contact"> </td>
          <td ng-bind="item.details"> </td>
        </tr>
      </tbody>
    </table>
    
    <h6 class="quarter"></h6>
    <a href="index.php" class="callbutton huge">I want to go back.</a>
    <h6 class="quarter"></h6><h6 class="quarter"></h6>
    
  </header>
</article>
    
<?php include("footer.php"); ?>